@extends('_layouts.blank')

@section('page-level-styles')
{{ HTML::style('assets/global/plugins/data-tables/DT_bootstrap.css') }}
{{ HTML::style('assets/global/plugins/bootstrap-datepicker/css/datepicker.css') }}
@stop

@section('page-level-plugins')
{{ HTML::script('assets/global/plugins/data-tables/jquery.dataTables.js') }}
{{ HTML::script('assets/global/plugins/data-tables/DT_bootstrap.js') }}
{{ HTML::script('assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js') }}
@stop

@section('page-level-script')
{{ HTML::script('assets/global/scripts/datatable.js') }}
{{ HTML::script('assets/global/scripts/datatable.vi.js') }}
{{ HTML::script('assets/admin/pages/scripts/user-list.js') }}
@stop

@section('jquery-document-ready')
UserList.init();
@stop

@section('page-content')
<?php
$isHideDelete   = CNamHoa::getHideClass('user-list', ['parameterInput' => ['sGroupActionName' => 'delete'], 'addClass' => 'hide']);
$isHideSetClass = CNamHoa::getHideClass('user-list', ['parameterInput' => ['sGroupActionName' => 'setclass'], 'addClass' => 'hide']);
$isHideAssign   = CNamHoa::getHideClass('user-list', ['parameterInput' => ['sGroupActionName' => 'assign_permission'], 'addClass' => 'hide']);
?>
<input type="hidden" class="error-no-action" value="{{ trans('user-pages.list.message.error-no-action') }}"/>
<input type="hidden" class="error-no-item" value="{{ trans('user-pages.list.message.error-no-item') }}"/>
<div class="row">
    <div class="col-md-12">
        <!-- Begin: life time stats -->
        <div class="portlet">
            <div class="portlet-body">
                <div class="table-container">
                    <div class="table-actions-wrapper">
                        <span></span>
                        <select class="table-group-action-input form-control input-inline input-small input-sm">
                            <option value="">{{ trans('system.select') }}...</option>
                            <!-- <option class="{{$isHideDelete}}" value="delete">{{ trans('system.button.delete') }}</option> -->
                            <option class="{{$isHideAssign}}" value="assign_permission">{{ trans('permission.set-role') }}</option>
                            <option value="export_excel">{{ trans('user-pages.list.export-excel') }}</option>
                        </select>
                        <select class="form-control input-inline input-sm assign_permission" style="display:none">
                            @foreach( $aRole as $role)
                            <option data-subtext="French's" value="{{ $role->id }}">{{ $role->name }}</option>
                            @endforeach
                        </select>
                        <button class="btn btn-sm blue table-group-action-submit"><i class="fa fa-check"></i> {{ trans('system.button.submit') }}</button>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="datatable_list" action="{{ route('user-list') }}">
                        <thead>
                            <tr role="row" class="heading">
                                <th width="1%">
                                    <input type="checkbox" class="group-checkable">
                                </th>
                                <th width="10%">
                                    {{ trans('user.userid') }}
                                </th>
                                <th width="25%">
                                    {{ trans('user.username') }}
                                </th>
                                <th width="25%">
                                    {{ trans('user.birthday') }}
                                </th>
                                <th width="10%">
                                    {{ trans('user.phone') }}
                                </th>
                                <th width="10%">
                                    {{ trans('system.actions') }}
                                </th>
                            </tr>
                            <tr role="row" class="filter">
                                <td></td>
                                <td>
                                    <div class="margin-bottom-5">
                                        <input type="text" class="form-control form-filter input-sm" name="filter_id" placeholder="{{ trans('user.userid') }}">
                                    </div>
                                    <div class="margin-bottom-5">
                                        <select name="filter_course" id="course" class="form-control form-filter input-sm">
                                            <option value="">{{ trans('classes.course') }}</option>
                                            @foreach($aCourse as $sKey => $sValue)
                                            <option value="{{{$sKey}}}">{{{$sKey}}}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </td>
                                <td>
                                    <div class="row">
                                        <div class="col-md-12 margin-bottom-5">
                                            <input type="text" class="form-control form-filter input-sm" name="filter_username" placeholder="{{ trans('user.username') }}">
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-4">
                                            <select name="filter_team" id="team" class="form-control form-filter input-sm">
                                                <option value="">{{ trans('classes.team') }}</option>
                                                @foreach($aTeams as $sKey => $sValue)
                                                <option {{ Input::get('filter_team') == $sValue->key ? 'selected="checked"' : null }} value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                        <div class="col-md-4">
                                            <select name="filter_level" id="level" class="form-control form-filter input-sm">
                                                <option value="">{{ trans('classes.level') }}</option>
                                                @foreach($aLevels as $sKey => $sValue)
                                                <option value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                        <div class="col-md-4">

                                            <select name="filter_crew" id="crew" class="form-control form-filter input-sm">
                                                <option value="">{{ trans('classes.crew') }}</option>
                                                @foreach($aCrews as $sKey => $sValue)
                                                <option value="{{ $sValue->key }}">{{ $sValue->data }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                </td>
                                <td>
                                    <div class="input-group date date-picker margin-bottom-5" data-date-format="dd-mm-yyyy">
                                        <input type="text" class="form-control form-filter input-sm" readonly name="filter_birthdayfrom" placeholder="{{ trans('user-pages.list.datefrom') }}">
                                        <span class="input-group-btn">
                                            <button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
                                        </span>
                                    </div>
                                    <div class="input-group date date-picker" data-date-format="dd-mm-yyyy">
                                        <input type="text" class="form-control form-filter input-sm" readonly name="filter_birthdayto" placeholder="{{ trans('user-pages.list.dateto') }}">
                                        <span class="input-group-btn">
                                            <button class="btn btn-sm default" type="button"><i class="fa fa-calendar"></i></button>
                                        </span>
                                    </div>
                                </td>
                                <td>
                                    <input type="text" class="form-control form-filter input-sm" name="filter_phone" placeholder="{{ trans('user.phone') }}">
                                </td>
                                <td>
                                    <div class="margin-bottom-5">
                                        <button class="btn btn-sm yellow filter-submit margin-bottom"><i class="fa fa-search"></i> {{ trans('system.search') }}</button>
                                    </div>
                                    <button class="btn btn-sm default filter-cancel"><i class="fa fa-refresh"></i> {{ trans('system.button.reset') }}</button>
                                </td>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- End: life time stats -->
    </div>
</div>
@stop